package com.cskaoyan.controller.wx.nj;


import com.cskaoyan.bo.wx.nj.OrderCommentWxBo;
import com.cskaoyan.service.wx.nj.OrderWxService;
import com.cskaoyan.service.wx.nj.WxOrderService;
import com.cskaoyan.vo.BaseRespVo;
import com.cskaoyan.vo.wx.nj.orderwx.OrderDetailWxVo;
import com.cskaoyan.vo.wx.nj.orderwx.OrderListWcVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/wx/order")

public class OrderWxController {

    @Autowired
    OrderWxService orderWxService;

    @Autowired
    WxOrderService wxOrderService;

    @GetMapping("/list")
    public BaseRespVo OrderWxList(int size,int page,int showType) {

        OrderListWcVo orderListWcVo = orderWxService.getWxOrderList(showType, page, size);

        return BaseRespVo.ok(orderListWcVo);
    }


    @GetMapping("/detail")
    public BaseRespVo OrderWxDetail(int orderId) {
//        int orderId = (int) map.get("orderId");

        OrderDetailWxVo orderDetailWxVo = orderWxService.getWxOrderDetailt(orderId);

        return BaseRespVo.ok(orderDetailWxVo);
    }

    @PostMapping("/comment")
    public BaseRespVo OrderWxComment(@RequestBody OrderCommentWxBo orderCommentWxBo) {

        orderWxService.setOrderWcComment(orderCommentWxBo);

        return BaseRespVo.ok();
    }



}
